﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using School.Admission;

namespace School.Pages.Admission
{
    public partial class FatherStudentsScheduler : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                int x = Convert.ToInt32(Session["fatherId"]);
                ddlFatherStudents.DataTextField = "Ar_FirstName";
                ddlFatherStudents.DataValueField = "Id";
                ddlFatherStudents.DataSource = Father.GetFatherstudents(Convert.ToInt32(Session["fatherId"]));
                ddlFatherStudents.DataBind();
                ddlFatherStudents.Items.Insert(0, new ListItem() { Value = "0", Text = "اختر الابن" });
            }
        }

        protected void lnkBtnOpenStudentResult_Click(object sender, EventArgs e)
        {
            Session["studentId"] = Convert.ToString(ddlFatherStudents.SelectedValue);
            Response.Redirect("../Admission/Reports/ShowClasscources.aspx");            
        }
    }
}